#include "devdialog.hpp"
#include "ui_device.h"
#include "devlist.hpp"
#include "sys/stat.h"

DeviceDialog::DeviceDialog()
{
	ui = new Ui_Devices;
	dl = new DevList;

	ui->setupUi(this);
	ui->dlist->setModel(dl);
	ui->dlist->resizeColumnsToContents();
}

DeviceDialog::~DeviceDialog()
{
	delete ui;
}

bool DeviceDialog::getDevice(Device& dev) const
{
	QModelIndex index = ui->dlist->currentIndex();
	return dl->getDevice(index, dev);
}
